# -*- encoding: utf-8 -*-

from odoo import models, fields, api, _
from odoo.addons import base_cw
from odoo.tools.float_utils import float_round, float_compare


class account_product_type(models.Model):
    _name = 'account.product.type'
    _description = u'成本类型科目设定'

    product_type = fields.Selection(base_cw.public.PRODUCT_TYPE, u'成本类型',  default=None)
    sale_account_id = fields.Many2one('cncw.account', u'销货科目',ondelete="restrict")
    purchase_account_id = fields.Many2one('cncw.account', u'进货科目',  ondelete="restrict")
    note = fields.Text(u'备注')
    active = fields.Boolean(u'启用', default=True)


    _sql_constraints = [
        ('product_type_unique', 'unique (product_type)', u'成本类型 必须唯一!')
    ]